package com.weishenai.customerassistant.controller.weChat;

import com.weishenai.customerassistant.common.Result;
import com.weishenai.customerassistant.entity.Electrical;
import com.weishenai.customerassistant.service.ElectricalService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@Api(tags = "小程序_配变信息管理")
@RestController
@RequestMapping("/wechat/area")
public class ElectricalWechatController {
    @Autowired
    private ElectricalService electricalService;

    @ApiOperation("小程序_根据输入的供电变压器部分名称查询配变信息")
    @ApiImplicitParam(name = "name", value = "配变名字")
    @GetMapping("/selectByName/{name}")
    public Object selectByName(@PathVariable("name") String name) {
        List<Electrical> list = electricalService.selectByName(name);
        return Result.success(list);
    }
}
